package Eyjafjalla.action;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.cards.AbstractCard;

public class IncreaseCardAction extends AbstractGameAction {
    public IncreaseCardAction(AbstractCard card,int d,int b,int m,int c){
        this.card = card;
        this.d = d;
        this.b = b;
        this.m = m;
        this.c = c;
    }

    @Override
    public void update() {

        card.baseDamage += d;
        if(card.baseDamage<0&&d!=0)
            card.baseDamage = 0;
        card.baseBlock += b;
        if(card.baseBlock<0&&b!=0)
            card.baseBlock = 0;
        card.baseMagicNumber += m;
        if(card.baseMagicNumber<0&&m!=0)
            card.baseMagicNumber = 0;
        card.magicNumber = card.baseMagicNumber;
        if(card.cost>=0&&c!=0)
            card.updateCost(c);
        card.applyPowers();

        this.isDone = true;
    }

    AbstractCard card;
    int d,b,m,c;
}
